﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MvcShop.Models
{
    [MetadataType(typeof(NewsMetadata))]
    public partial class News
    {
    }

    public class NewsMetadata
    {
        [DisplayName("新闻标题")]
        [Required(ErrorMessage = "新闻标题不能为空。")]
        [StringLength(150, ErrorMessage = "新闻标题不能超过50字节。")]
        public string Title { get; set; }

        [DisplayName("首页显示")]
        public bool HeadLine { get; set; }

        [DisplayName("标题醒目")]
        public bool HighLight { get; set; }

        [DisplayName("新闻内容")]
        [Required(ErrorMessage = "新闻内容不能为空。")]
        public string Content { get; set; }

        [DisplayName("发布时间")]
        public DateTime DateTime { get; set; }
    }
}
